<?php


namespace app\shop\model;


use think\Model;

class GoodsTypeModel extends Model
{
    protected $table = 'dp_goods_type';
    protected $pk = 'id';
    protected $field = true;



    public static function getList()
    {
        return self::paginate(10);
    }

    public static function saveType($data, $id=0)
    {
        if($id==0){
            return self::create($data);
        }else{
            return self::where('id',$id)->update($data);
        }

    }

    public static function getRes()
    {
        return self::column('id,name');

    }

}